﻿<%@ WebHandler Language="C#" Class="checkstatusroom" %>

using System;
using System.Web;
using LibQLKS.LeTan;

public class checkstatusroom : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        object objstr = null;
        try{
            string nameroom = context.Request.QueryString["r"];
            string kind = context.Request.QueryString["k"];
            string strsql="";
            LT_Phong phong = new LT_Phong();
            strsql = "select cast(IDPhong as varchar(20)) +'/' + cast(TinhTrang as varchar(2)) + '/' + cast(isnull((select pdp.idpdp from lt_phieudatphong pdp inner join lt_phieudatphongct dpct on dpct.idpdp=pdp.idpdp where  dpct.idphong=phong.idphong),'') as varchar(20)) from LT_Phong phong where LTrim(Rtrim(TenPhong))='" + nameroom.Trim() + "'";            
            objstr = phong.GetReturnOne(strsql);
            //pdp.tinhtrang=1 and
        }catch{}
        
        context.Response.ContentType = "text/plain";
        if (objstr != null)
        {
            context.Response.Write(objstr.ToString());
        }
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}